package com.adl.controller;

import com.adl.entity.Person;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Date;

/**
 * Created by ADL on 2017/6/13.
 */
@Controller
public class CommonController /*implements Controller*/ {
    /* @Override
     public ModelAndView handleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
         return null;
     }*/
    @RequestMapping("/index")
    public Object index(ModelMap modelMap) {
        Person person = new Person();
        person.setName("ADL");
        person.setAge(32);
        modelMap.addAttribute("now", new Date());
        modelMap.put("user", person);

        return "index";
    }
}
